package ThreadBasic.Single;

import java.util.Collections;
import java.util.Scanner;

/**
 * @author yyh
 * @create 2020-11-03 15:41
 */
public class R {

    public static void main(String[] args) {
//        Scanner scanner = new Scanner(System.in);
//
//        String s = scanner.nextLine();
//        System.out.println("原始数据"+s);

//        char[] chars = s.toCharArray();
//        int count = 0;
//
//        for (int i = 0; i < chars.length; i++) {
//            if(chars[i] >= 65 && chars[i] <= 90){
//                count++;
//                System.out.println(chars[i]);
//
//            }else if(chars[0] < 65 | chars[0] > 90){
//                System.out.println("第一次字母不是大写");
//            }
//        }
//        System.out.println("大写字母一共有："+count);

//        System.out.println("一共有 "+s.length()+"个字符");
//        for (int i = s.length() -1; i >= 0; i--) {
//            System.out.print(s.charAt(i));
//        }
        System.out.println("按1进行字符串拼接，按2进行整数相加，按3进行浮点数相加，按4表示推出");
        boolean flag = true;
        Scanner scanner = new Scanner(System.in);
        System.out.println("选择操作数：");
        int i = scanner.nextInt();
        while(flag){

            switch (i){
                case 1:{
                    String s1 = scanner.nextLine();
                    String s2 = scanner.nextLine();
                    String s = twoCharAdd(s1, s2);
                    System.out.println(s);
                    break;
                }

                case 2:{
                    int s1 = scanner.nextInt();
                    int s2 = scanner.nextInt();
                    twoCharAdd(s1,s2);
                    break;
                }

                case 3:{
                    double s1 = scanner.nextDouble();
                    double s2 = scanner.nextDouble();
                    twoCharAdd(s1,s2);
                    break;
                }

                case 4:{
                    flag = false;
                }
            }
        }



    }

    public static String twoCharAdd(String s1 ,String s2){
        return s1+s2;
    }

    public static  int twoCharAdd(int s1, int s2){
        return s1 + s2;
    }

    public static double twoCharAdd(double s1, double s2){
        return s1 + s2;
    }
}
